<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>丁旭一龙</title>
    <style>
        div {
            width: 100px;
            height: 100px;
            background-color: red;
        }
    </style>
</head>
<body>
    <div></div>
    <script>
        var starTime = 0;
        var isMove = false;
        function tap(obj, callback){
            obj.addEventListener('touchstart', function(e) {
                starTime = Date.now();
            });
            obj.addEventListener('touchmove', function(e) {
                isMove = true;
            });
            obj.addEventListener('touchend', function(e) {
                var endTime = Date.now();
                if((endTime - starTime < 150) && !isMove){
                    callback && callback();
                }
            });
        };
        var div = document.querySelector('div');
        tap(div, function(e){
            console.log('丁旭一龙 tap');
        })
    </script>
</body>
</html>